//箭头函数 没有this 没有arguments
let Fn = (...arg)=>{
  console.log(arg)
}
Fn(3,43,5)
let Fn1 = (x,y)=>({total:x+y});
let a = function (x){
  return function (y){
    return x+y;
  }
}
a(1,2)
let a1 = x => y => x+y;

//this的问题 看. 前面是谁 this就是谁
//对象的大括号{}不是作用域，只有大括号{}配let才是作用域
let a2=1;
let obj = {
  a2:2,
  fn(){//this=obj
    console.log(this.a2)//2
    setTimeout(()=>{
      console.log(this.a2)//undefined
      console.log(arguments)//上级作用域有
    })
  },
  fn2:()=>{//this=window
    console.log(this.a2)//undefined
    // console.log(arguments)报错
  }
}
obj.fn();
